bitkeeper revision 1.1726.1.3 (42b9a279xCcev3J_vAFv3hHoqI8lVw)
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 22 Jun 2005 17:40:09 +0000 (17:40 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 22 Jun 2005 17:40:09 +0000 (17:40 +0000)
Add cmpxchg8b support for writable page tables
(emulation code path), which is needed to make atomic pae l1
page table updates work.
Signed-off-by: Scott Parish <srparish@us.ibm.com>
xen/arch/x86/mm.c

index 9b3d631bc06224808f6df9084ae752d3b2bcaf21..0487da6a4408559ffd257a35948fdfcd1dadf09f 100644 (file)
@@ -2793,12 +2793,24 @@ static int ptwr_emulated_cmpxchg(
     return ptwr_emulated_update(addr, old, new, bytes, 1);
 }
 
+static int ptwr_emulated_cmpxchg8b(
+    unsigned long addr,
+    unsigned long old,
+    unsigned long old_hi,
+    unsigned long new,
+    unsigned long new_hi)
+{
+    return ptwr_emulated_update(
+        addr, ((u64)old_hi << 32) | old, ((u64)new_hi << 32) | new, 8, 1);
+}
+
 static struct x86_mem_emulator ptwr_mem_emulator = {
-    .read_std         = x86_emulate_read_std,
-    .write_std        = x86_emulate_write_std,
-    .read_emulated    = x86_emulate_read_std,
-    .write_emulated   = ptwr_emulated_write,
-    .cmpxchg_emulated = ptwr_emulated_cmpxchg
+    .read_std           = x86_emulate_read_std,
+    .write_std          = x86_emulate_write_std,
+    .read_emulated      = x86_emulate_read_std,
+    .write_emulated     = ptwr_emulated_write,
+    .cmpxchg_emulated   = ptwr_emulated_cmpxchg,
+    .cmpxchg8b_emulated = ptwr_emulated_cmpxchg8b
 };
 
 /* Write page fault handler: check if guest is trying to modify a PTE. */